
var express = require('express');
var router = express.Router();
var sql = require('../sql.js');
/*  var jsonWrite = function(res, ret) {
  if (typeof ret === 'undefined') {
      res.json({
          code: '1',
          msg: '操作失败'
      });
  } else {
      res.json(ret);
  }
}; */ 
/* GET users listing. */
router.use('/', function(req, res) {
  /*res.send('1');*/

  var params = req.body;  
  console.log(params);
  sql("insert into admin(userName,pwd)values(?,?)",[params.userName, params.pwd], function(qerr,vals,fields){  
    //do something   
    if (qerr) throw qerr;
        if (vals) {
            return res.json(vals)
        }
});  
});

module.exports = router;
